home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 3: The Continuation / 17-Bit_The_Continuation_Disc.iso / amigan / amigan 19 / resource / resource.doc < prev    next >
Encoding:
Text File  |  1994-01-27  |  42.7 KB  |  903 lines

  1.        Documentation for ReSource (C) 1988 Glen McDiarmid
  2.  
  3.       TO GET STARTED QUICKLY:
  4.       ****************************************************************
  5.       Don't forget to put arp.library in your LIBS: directory!
  6.       ****************************************************************
  7.       Run ReSource from a CLI, and when you are presented with a file
  8.       requester, select an executable file to disassemble (anything
  9.       within your "C" directory will do nicely).  Alternatively, you
  10.       may disassemble Kickstart by supplying a filename of "*".  Once
  11.       loaded, you may scroll forwards/backwards through the file with
  12.       the down/up arrow keys.  Using the shift key with the up/down
  13.       arrow keys will move you faster through the file.  You may also
  14.       use mouse-scrolling, by holding the left mouse button down, then
  15.       SLOWLY moving the mouse forwards or backwards, depending on which
  16.       way you want to move through the file.  While moving forwards
  17.       with the mouse, holding the left Amiga key down will start the
  18.       label creation process, in a controlled manner.  When labels are
  19.       created, ReSource decides which type of data is being labelled,
  20.       and it is generally correct in its judgement.  Once you have made
  21.       some labels, select the 'Fill-in data types' menu item, under the
  22.       "DISPLAY" menu.  Once you have created labels from all areas of
  23.       code, select 'Fill-in data types' again, and you may then scroll
  24.       through the file, checking for yourself that all is in order
  25.       (there will occasionally be cases where ReSource made an
  26.       incorrect judgement, and code made be shown as ASCII, or vice-
  27.       versa).  Use one of the "Set data types" sub-menu selections, to
  28.       set the correct data type.  Remember to use the "Fill-in data
  29.       types" command again, so that code and data are shown correctly.
  30.  
  31.       If you are working on a large file, you may wish to save your
  32.       work, so that you can continue it at a later time.  To do this,
  33.       select "save all" under the "PROJECT" menu.  When you use the
  34.       "save all" option, you are creating a "ReSource file", as it is
  35.       only useable by ReSource.  By default, the filename will end in
  36.       ".RS".  You may change this if you like.
  37.  
  38.       ****************************************************************
  39.       ABOUT RESOURCE:
  40.       ReSource is an interactive disassembler.  To give you an idea of
  41.       which files can and cannot be disassembled, the following is a
  42.       list of files from a Workbench 1.2 disk, that ReSource can
  43.       disassemble:
  44.       C directory: all
  45.       L directory: all
  46.       LIBS directory: all
  47.       DEMOS directory: Boxes, Dots, Spots
  48.       SYSTEM directory: CLI, DiskCopy, Format, GraphicDump, IconEd,
  49.       Say, SetMap.
  50.       DEVS directory: all keymaps, all printer drivers, everything
  51.       ending in ".device".
  52.       FONTS directory: everything within sub-directories
  53.       (topaz/11,emerald/17, etc.)
  54.       UTILITIES directory: Calculator, Notepad
  55.       ROOT directory: Preferences, Clock
  56.  
  57.       I personally wanted a good disassembler to fix bugs in many of
  58.       the public domain programs that I use.  I was also interested in
  59.       getting to know how C programs worked, at the assembly language
  60.       level.  ReSource is the result of 3 and a half months full-time
  61.       effort; during this time I have been using each version
  62.       extensively.  I am very impatient when it comes to waiting for
  63.       programs to complete operations, this has resulted in a
  64.       disassembler that is extremely fast, at the cost of memory usage.
  65.       Even though ReSource was written purely in assembly language, it
  66.       uses lots of memory, especially when disassembling large
  67.       programs.  Generally, if you have 1.5 Megs of memory, you will be
  68.       able to disassemble most programs.  To disassemble Kickstart, you
  69.       will require at least 2 Megs if you have a hard drive, or 3.5
  70.       Megs if you do not have a hard drive.  As a further condition,
  71.       there must be at least 1.1 Megs of contiguous memory, for the
  72.       attributes table.
  73.       ****************************************************************
  74.       GENERAL USAGE:
  75.       ****************************************************************
  76.       Don't forget to put arp.library in your LIBS: directory!
  77.       ****************************************************************
  78.       Disassembling a program consists of examining a load file
  79.       (sometimes called "executable" or "object" files), and from the
  80.       information contained therein, create a text file (assembler
  81.       source code) which, when assembled, can be used identically to
  82.       the original load file.  It takes many, often hundreds, of hours
  83.       of painstaking work to become proficient at disassembling even a
  84.       small program manually.  Even experts can spend many hours
  85.       disassembling very small programs, while large Amiga programs may
  86.       take weeks.  From now on, this will not be the case with Amiga
  87.       programs.  Large programs (100K or larger) can be disassembled in
  88.       an evening, while small programs (such as CD, PROMPT, AVAIL,
  89.       ECHO, FILENOTE, etc., take around 3-5 seconds to produce re-
  90.       assemblable source code.
  91.  
  92.       As an example, let's disassemble LoadWB, which you'll find in the
  93.       C directory of just about any booting disk, including a standard
  94.       Workbench disk (make sure that it comes from a V1.2 Workbench,
  95.       not 1.1 or 1.3!  At the CLI prompt, type:
  96.  
  97.       RUN RS C:LOADWB
  98.  
  99.       You don't really have to use the "run" command, but I find it
  100.       convenient, so maybe you will too.  When ReSource starts running,
  101.       it will load the file "loadwb" from the C directory, and
  102.       disassemble the first page for you.  We can now start the label-
  103.       creation process.  This involves getting ReSource to examine
  104.       lines of code, and on each line, if there is any reference to
  105.       another part of the program, ReSource will decide which type of
  106.       data is being referenced.  For example, the first line of code in
  107.       our program is:
  108.  
  109.               MOVE.L  SP,START+$01E0
  110.  
  111.       Okay, go to the menus, under "LABELS" menu, you'll find "Create
  112.       single".  A sub-menu box will pop out, and from this, select
  113.       "Address symbol dest".  Now, the first line of code in our
  114.       program should be:
  115.  
  116.               MOVE.L  SP,lbL0001E0
  117.  
  118.       Now, scroll forward through the program (using shift-down arrow),
  119.       until you find a line starting with "lbL0001E0":
  120.  
  121.       lbL0001E0       dc.l    0
  122.  
  123.       The label "lbL0001E0" is something that ReSource has just now
  124.       created.  In this case, ReSource decided that the data being
  125.       referenced was a Longword, hence the "L" in "lbL0001E0".  If it
  126.       was code that was being referenced, the label would have been
  127.       "lbC0001E0" instead.  There are five type of data recognized by
  128.       ReSource:
  129.  
  130.       ASCII - CODE - BYTES - WORDS - LONGWORDS
  131.  
  132.       The processes involved in deciding which type of data is being
  133.       referenced is quite complex, and such things as the surrounding
  134.       code/data, the relative position of reloc32 areas, hunk types,
  135.       relative position from the start of a hunk, the actual
  136.       information being referenced, whether the data is word/longword
  137.       aligned, the actual instruction from which the reference was
  138.       derived, the proximity of other labels, and what data types they
  139.       refer to, all take part in the decision-making process.  If the
  140.       first line of code in out program had been:
  141.  
  142.               MOVE.W  SP,START+$01E0
  143.  
  144.       , then the label created would have been "lbW0001E0" instead, and
  145.       the data type at this label would have been set to words.  If you
  146.       like, you can manually set the data type of any byte in the
  147.       program, by selecting a sub-menu item from the "Set data type"
  148.       menu item, under "DISPLAY" in the menus.  This will not create a
  149.       label, but it will re-define the current byte within the file (on
  150.       the top line of the display) as being ASCII, CODE, or whichever
  151.       data type you selected.  Generally, this is not required, except
  152.       sometimes in large programs, but after letting ReSource do its
  153.       thing first.  If you like doing things with the mouse, you can
  154.       even set the data type this way.  Once you have mastered mouse
  155.       scrolling, try holding down the left-shift key while still
  156.       holding down the left mouse button.  This will display everything
  157.       as if it were set to the data type BYTES.  Holding down the left
  158.       alt key will display everything as if it were set to ASCII.
  159.       Similarly, the left shift and left alt keys held down together to
  160.       show everything in WORDs; hold down the ctl key and everything
  161.       will be displayed as CODE.  Hold down all three, and everything
  162.       will be shown as LONGWORDS.  If you decide make this data type
  163.       permanent, press the menu button, and the current position within
  164.       the program will be set to the data type currently being
  165.       displayed.  By holding down the right alt key, you can remove
  166.       labels while scrolling.
  167.  
  168.       Now scroll back to the start of the program (select "Start of
  169.       file" submenuitem, under the "Absolute" menuitem under the
  170.       "CURSOR" menu).  Alternatively, just use the up arrow key, to
  171.       scroll back slowly.  Look in the screen title bar to find out how
  172.       far you are from the start of the file.  This offset is being
  173.       shown in hexdecimal.  Now, use the down arrow key to scroll
  174.       forward to the second line of code in our program:
  175.  
  176.               MOVE.L  D0,START+$01E8
  177.  
  178.       Again, select the "Address symbol dest" submenuitem, to create
  179.       the label "lbL0001E8".  Do this to as many lines of code as you
  180.       like, so that you become familiar with the label creating
  181.       process.  What you have just done can be done far quicker, by
  182.       using the "Create multiple" label functions.  Firstly, select the
  183.       "Open" menuitem, under "PROJECT" in the menus.  Again, we will
  184.       use "LoadWB" from within your C directory.  Once it is loaded,
  185.       look in the menu under "LABELS", go to the menuitem "Create
  186.       multiple", and select "All" from the sub-menuitem box.  Around
  187.       three quarters of a second later, you should be at position
  188.       "0001C8" relative from the start of the file.  The top line of
  189.       the display should read:
  190.  
  191.       lbL0001C8       dc.l    0
  192.  
  193.       If this is correct, you should now find some more code to make
  194.       labels from.  To do this, you could use the down arrow key to
  195.       scroll forward, the shift-arrow key to page forward, or let
  196.       ReSource do the searching for you, by selecting "Next unparsed
  197.       code" from the "CURSOR" menu.  If there is no more code that has
  198.       not been parsed, you will be returned to the start of the file.
  199.       However in this case, there is more code to parse, so go to it!
  200.       When eventually "Next unparsed code" returns you to the start of
  201.       the file, slowly scroll through the file, and examine as you go.
  202.       You should find some ASCII, but it isn't being shown like it
  203.       really should.  This is the time to select "Fill-in data types"
  204.       from the "DISPLAY" menu.
  205.  
  206.       Okay, now the program is completely disassembled right?  Well,
  207.       nearly.  If you followed the above instructions to the letter,
  208.       there will be once more section of code that labels have NOT been
  209.       created from.  This will be at offset "000584".  This is because
  210.       this area of the program was only recognized as code, after it
  211.       had been skipped over.  In fact, the only reference to this part
  212.       of the program is made at offset "0005E6", and the code is:
  213.  
  214.               JSR     lbC000584
  215.  
  216.       Again, create multiple labels within this area, and search for
  217.       the next unparsed code.  If you select "Next unparsed code" while
  218.       at the start of the file, and ReSource cannot find any, then
  219.       again select "Fill-in data types", and this should complete the
  220.       disassembly of LoadWB.
  221.  
  222.       Actually, at this point, I generally will change some of the
  223.       labels, so that they are meaningful.  For instance, the first
  224.       line of code places the contents of the SP register at
  225.       "lbL0001E0", right?  Scroll forward to the line starting with
  226.       this label, and select "Address symbol" submenuitem, from the
  227.       "Create single" menuitem, under "LABELS" menu.  You will be
  228.       requested to input a new label name.  I would call this label
  229.       "SaveSP"; you call it anything you like.  Now, scroll backwards
  230.       to the offset "0000D2":
  231.  
  232.               MOVE.L  SaveSP,SP
  233.  
  234.       We didn't change this line, so what is going on?  You have just
  235.       witnessed one of the major benefits of an interactive
  236.       disassembler; any label changes you make are reflected throughout
  237.       the entire program, instantly.  Anywhere else in the program that
  238.       you can place a meaningful label, will help greatly in
  239.       recognizing how a program executes, without actually executing
  240.       it.  Also, if you wish to make changes to the source, meaningful
  241.       labels help greatly.  While still within ReSource, you may add
  242.       comments, both full-line, and end-of-line, to aid in the
  243.       understanding of the program.
  244.       ****************************************************************
  245.       EXPLANATION OF FUNCTIONS:
  246.       The following section gives details of the uses of each function,
  247.       as they are shown in the menus.  Not all functions are enabled in
  248.       all versions, this is especially so in V0.x (demo version).
  249.  
  250.       PROJECT/Abort:
  251.               Use this to abort out of most functions.
  252.  
  253.       PROJECT/Open:
  254.               Requests you to select a file to open.  Use this function
  255.       to load executable files, as well as ReSource files.
  256.  
  257.       PROJECT/Restore:
  258.               Same as PROJECT/Open, but assumes that you wish to open
  259.       the same file as you last opened.
  260.  
  261.       PROJECT/Save .RS:
  262.               Saves the file that you are currently working on, in a
  263.       form useable only by ReSource.  Also saves the current location
  264.       with the file.  To continue work on the file later, use the
  265.       PROJECT/Open function.
  266.  
  267.       PROJECT/About:
  268.               Gives you some specific details about the version of
  269.       ReSource that you are currently using.
  270.  
  271.       PROJECT/Quit:
  272.               Asks you for confirmation, then quits without saving.
  273.  
  274.       OUTPUT/Save .asm:
  275.               Saves current file in assembler source code format.
  276.  
  277.       OUTPUT/O/P directory:
  278.               Requests you to supply the name of a directory that .asm
  279.       files will be sent to (you can still change this when you supply
  280.       the name of the output file, it just makes it easier if you are
  281.       disassembling many files).
  282.  
  283.       OUTPUT/Tabs:
  284.               Use to select between real tabs (ASCII value 9) and
  285.       spaces being used in the output source code.
  286.  
  287.       DISPLAY/Hiliting:
  288.               Selective use of inverse video can be useful to give
  289.       extra information about parts of a file.  For instance, you may
  290.       want to get a quick idea of which parts of a file came from a BSS
  291.       hunk, rather than CODE or DATA hunks.  To do this, select
  292.       DISPLAY/Hiliting/BSS hunks.
  293.  
  294.       DISPLAY/Hiliting/Reloc32:
  295.               I find it particularly useful to hilite the Reloc32
  296.       areas, especially when determining data types (reloc32 is
  297.       documented in the Amiga technical reference manual.  It
  298.       ultimately means that a number of longwords in the file point to
  299.       somewhere in memory, relative to the start of one of the hunks of
  300.       the file.  This almost always end up being somewhere within the
  301.       file.  This information helps ReSource greatly when defining data
  302.       types).
  303.  
  304.       DISPLAY/Hiliting/Chip load hunks:
  305.               Certain hunks of a load file may only be loaded into chip
  306.       memory.  Usually, graphics, especially sprites, will be included
  307.       in one of these special hunks, and this information is sometimes
  308.       useful, especially when you intend to re-assemble the file.
  309.       "Chip load hunks" will hilite these hunks for you, also fast load
  310.       hunks may be hilited.
  311.  
  312.       DISPLAY/Hiliting/Symbol scan:
  313.               For all lines that you have created labels from, these
  314.       lines will be hilited.
  315.  
  316.       DISPLAY/Hiliting/Data type uncertain:
  317.               For most labels that ReSource creates automatically, it
  318.       is certain of the data type that it assigns.  Sometimes though,
  319.       it cannot be 100% sure, and this function will hilite all lines
  320.       that fall into this category.
  321.  
  322.       DISPLAY/Hiliting/Data type known:
  323.               Similar to above function, only the lines where the
  324.       ReSource was certain of the data type, will be hilited.
  325.  
  326.       DISPLAY/Hiliting/Internally produced refs:
  327.               All lines which have a label that was created by
  328.       ReSource, will be hilited.
  329.  
  330.       DISPLAY/Set data type:
  331.               When you are certain of which type of data that you are
  332.       looking at, select from one of the submenu items:
  333.       Code - Ascii - Bytes - Words - Longwords
  334.  
  335.       DISPLAY/Set numeric base:
  336.               By default, all numbers are shown in hexdecimal (base
  337.       16).  You can change this to ASCII, DECIMAL or BINARY on any line
  338.       by selecting from the appropriate sub-menu item.  To change back
  339.       to HEXDECIMAL, simply select the same function again.  It is
  340.       possible to change the default to decimal for numbers less than
  341.       16, or less than 10, using the decimal conversion function (see
  342.       below).
  343.  
  344.       DISPLAY/Decimal conversion:
  345.               By default, all numbers are show in hexdecimal.  You can
  346.       have numbers less than 16, or numbers less than 10, shown in
  347.       decimal throughout the file, by selecting one of the appropriate
  348.       sub-menu items.
  349.  
  350.       DISPLAY/Block-fill:
  351.               This function will probably not get much use.  It can be
  352.       used to set the data type of blocks of data.  For example, in a
  353.       particular file, there may a large section of code, maybe 100K or
  354.       so, and rather than rely on ReSource to make the correct
  355.       judgement of data type every time, you can set the data type of
  356.       every byte in the file to code, by doing the following:  Scroll
  357.       to the start of the block.  Set the data type here to CODE.
  358.       Select the "CURSOR/Remember" function.  Now, scroll to the end of
  359.       the block (don't use any function that stacks the cursor
  360.       position, such as "CURSOR/Absolute/End of file", as this will
  361.       change the remembered offset.  When you get to the end of the
  362.       block, select the "DISPLAY/Block-fill" function.  The type of
  363.       data at the start of the block will be echoed throughout the
  364.       entire block.
  365.  
  366.       DISPLAY/Fill-in data types:
  367.               This function has several uses, and will be one of the
  368.       most-used functions.  To understand what this function does, you
  369.       will need to know how ReSource keeps track of data types (see
  370.       section "Inside ReSource").  Suffice it to say, when you set the
  371.       data type anywhere within a file, that data type is immediately
  372.       echoed forward, to a maximum of several hundred bytes, but will
  373.       not change any other places where the data type has already been
  374.       set, or where there is an address symbol (label) on a line.
  375.       Where there is large areas of a file where the data type has not
  376.       been set, this function attempts to set the data type where
  377.       appropriate.  All of the above is done in the first pass.  On the
  378.       second pass, the length of each line is set, this is particularly
  379.       useful where there is large areas of ASCII.  This function should
  380.       always be used just before saving a file as source code (OUTPUT/
  381.       Save .asm).
  382.  
  383.       DISPLAY/Set counter:
  384.               The current offset in a file is always shown in the title
  385.       bar, in hexdecimal.  This is normal zero at the start of the
  386.       file.  You can change this, so that it is zero at somewhere other
  387.       than the start of the file, by using this function.  You may use
  388.       this function to measure the size of a hunk, for example.  To
  389.       "reset" the counter, use the function "DISPLAY/Reset counter".
  390.  
  391.       DISPLAY/Reset counter:
  392.               Resets the offset counter, in the title bar, so that it
  393.       is zero at the start of the file.  See "DISPLAY/Set counter".
  394.  
  395.       SYMBOLS:
  396.               When you create an assembly-language program, if you wish
  397.       to allocate some memory, you will probably have somewhere in you
  398.       file:
  399.  
  400.               JSR     _LVOAllocMem(A6)
  401.  
  402.       If you were to disassemble this program, this line of code would
  403.       be show as:
  404.  
  405.               JSR     -$0228(A6)
  406.  
  407.       , which is not particularly meaningful.  When disassembling a
  408.       program, if you can figure out which library base the A6 register
  409.       is pointing to (in this case, it would be the EXEC library), you
  410.       can get ReSource to make the appropriate substitution.  In this
  411.       example, you would select "SYMBOLS/E-G/Exec library".  Following
  412.       is another example:
  413.  
  414.               MOVE.L  #$00038007,D7
  415.               MOVE.L  4,A6
  416.               JSR     -$006C(A6)
  417.  
  418.       The second line loads Execbase into the A6 register, so you
  419.       should move the third line to the top of the display, and select
  420.       "SYMBOLS/E-G/Exec library".  Scroll back a couple of lines, and
  421.       you would see:
  422.  
  423.               MOVE.L  #$00038007,D7
  424.               MOVE.L  4,A6
  425.               JSR     _LVOAlert(A6)
  426.  
  427.       If you looked at the documentation for the Exec "Alert" call, you
  428.       would find that one of the input parameters is required to be in
  429.       the D7 register.  If you then looked in the include file "exec/
  430.       alerts.i", you would find that the number "$00038007" consists of
  431.       three values, OR'd together:
  432.  
  433.       AT_Recovery  -  AG_OpenLib  -  AO_DOSLib
  434.  
  435.       There is no need to go to all this trouble, simple line up the
  436.       first line with the top of the display, and select "SYMBOLS/A-B/
  437.       Alert codes", and ReSource will make the appropriate
  438.       substituition for you:
  439.  
  440.               MOVE.L  #AT_Recovery!AG_OpenLib!AO_DOSLib,D7
  441.               MOVE.L  4,A6
  442.               JSR     _LVOAlert(A6)
  443.  
  444.       Now isn't that much better than the original?  There are over 200
  445.       different classes of symbols that ReSource can substitute (only
  446.       two are enabled in the demo version).
  447.  
  448.               Consider the following lines of code:
  449.  
  450.               MOVE.L  4,A4
  451.               MOVE.L  #$100000,$003A(A4)
  452.  
  453.       Let's assume that you wish to substitute a symbol for the "$003A"
  454.       in the second line of code.  By default, ReSource will attempt to
  455.       substitute a symbol for the first number that it finds in a line
  456.       of code.  To change this, select "SYMBOLS/Set source/dest/
  457.       Destination", and then the appropriate symbol base (Exec library,
  458.       in this example).
  459.  
  460.       CURSOR/Remember:
  461.               Where it is possible to lose your place within a file by
  462.       using certain functions (such as "CURSOR/Absolute/Start of
  463.       file"), ReSource will store the current cursor location, just
  464.       prior to the function being executed.  To return to the previous
  465.       cursor location, select "CURSOR/Absolute/Previous location".
  466.       When you plan to return to a specific place within the file,
  467.       using this function will make it easier to do so.  It simply
  468.       stores the cursor location on a stack, for later access.
  469.  
  470.       CURSOR/Clear Loc stack:
  471.               The cursor location stack can contain up to 256
  472.       locations.  If more locations are "pushed" onto this stack, the
  473.       location at the bottom (the oldest) are forgotten.  This function
  474.       will empty the cursor location stack.
  475.  
  476.       CURSOR/Relative/Next byte:
  477.               The cursor position is incremented.
  478.  
  479.       CURSOR/Relative/Previous byte:
  480.               The cursor position is decremented.
  481.  
  482.       CURSOR/Relative/Next line:
  483.               Scroll forward by one line.
  484.  
  485.       CURSOR/Relative/Previous line:
  486.               Scroll backwards by one line.  The length of a line will
  487.       depend on what the data type is.  Until you first use "DISPLAY/
  488.       Fill-in data types", backwards scrolling may not be quite what
  489.       you expect.
  490.  
  491.       CURSOR/Relative/Next page:
  492.               Scroll forward by one page.  This will be approximately
  493.           20 lines.
  494.  
  495.       CURSOR/Relative/Previous page:
  496.               Scroll backwards by one page.  This will be approximately
  497.           20 lines.
  498.  
  499.       CURSOR/Relative/Skip forward:
  500.               Scroll forward by approx 4096 bytes ($1000).
  501.  
  502.       CURSOR/Relative/Skip Backward:
  503.               Scroll backward by approx 4096 bytes ($1000).
  504.  
  505.       CURSOR/Relative/Next unparsed code:
  506.               Scroll forward to the next line of code, that has been
  507.       labelled, and that has not been parsed for labels yet.
  508.  
  509.       CURSOR/Relative/Next data type change:
  510.               Scroll forward to the next byte whose data type is
  511.       different to the data type of the current byte.
  512.  
  513.       CURSOR/Relative/Previous data type change:
  514.               Scroll backward to the first byte found whose data type
  515.       is different to the data type of the current byte.
  516.  
  517.       CURSOR/Relative/Next uncertain data type:
  518.               Scroll forward to the next position within the file that
  519.       ReSource has labelled, but at the time was not quite sure of
  520.       which data type to set.
  521.  
  522.       CURSOR/Relative/Next backward reference:
  523.               Using the "CURSOR/Absolute/Backward reference" function,
  524.       it is possible to find the first reference to the current
  525.       position within the file.  Use this function to find further
  526.       references to the same position.  The search function could be
  527.       used instead, but may also find references within comments,
  528.       mnemonics, or even within other labels.
  529.  
  530.       CURSOR/Absolute/End of file:
  531.               Move cursor to the last line of the file.
  532.  
  533.       CURSOR/Absolute/Start of file:
  534.               Move cursor to the first line of the file.
  535.  
  536.       CURSOR/Absolute/Forward reference:
  537.               I'll use an example to explain this one:
  538.  
  539.                           JSR    lbC0132DE
  540.  
  541.               If you wanted to "check out" the subroutine at label
  542.       "lbC0132DE", but later return to the current cursor position,
  543.       simply scroll until this line is on the top line of the display,
  544.       and select "CURSOR/Absolute/Forward reference".  The current
  545.       cursor location is stored (on a stack), so that you can return to
  546.       this cursor position, using the "CURSOR/Absolute/Previous
  547.       location" function.
  548.  
  549.       CURSOR/Absolute/Forward reference:
  550.               This is similar to the "CURSOR/Absolute/Forward
  551.       reference" function, except that on a line such as:
  552.  
  553.                           MOVE.L  lbL00DEAF,lbL00BEEF
  554.  
  555.               the second label is used (lbL00BEEF), rather than the first
  556.       (lbL00DEAF).
  557.  
  558.       CURSOR/Absolute/Backward reference:
  559.               Use to find the first reference made to the current
  560.       cursor position.  See "CURSOR/Absolute/Next backward reference".
  561.  
  562.       CURSOR/Absolute/Previous location:
  563.               With many functions that change the cursor location
  564.       substantially, the current cursor position is stored on a stack.
  565.       To "pop" the last saved location, use this function.
  566.  
  567.       CURSOR/Scrolling speed:
  568.               You can select from five scrolling speeds.  This relates
  569.       to the speed/smoothness of scrolling when using the "CURSOR/
  570.       Relative/Next line" and "CURSOR/Relative/Previous line" functions.
  571.  
  572.       CURSOR/Search/Set search pattern:
  573.               You will be requested to input a string.  Unless you
  574.       select "CANCEL", the string you input will be searched for
  575.       immediately, starting at the current cursor position.  Normal ARP
  576.       wildcards are accepted:
  577.  
  578.                   (a|b|c)   Will match one of a, b or c.
  579.                             These can be patterns.
  580.  
  581.                   ? Matches any single character
  582.                   #<pat>   Pattern repeated 0 or more times,
  583.                            in particular, #? matches anything.
  584.  
  585.                   [char]   A set of characters, for example,
  586.                            [abc] or [a..c] specify the same set.
  587.  
  588.                   [^char]   Match everything but this set of characters.
  589.  
  590.                   *         0 or more occurances of any character.
  591.  
  592.       CURSOR/Search/Find next occurence:
  593.               Using the current search string, search forward from the
  594.       current cursor position.  See "CURSOR/Search/Set search pattern".
  595.  
  596.       LABELS/Create single/End-of-line comment:
  597.               You will requested for a string, which will be shown at
  598.       the end of the current line, starting with " ; ".
  599.  
  600.       LABELS/Create single/Full-line comment:
  601.               You will requested for a string, which will be shown on a
  602.       seperate line, previous to the current line, starting with "; ".
  603.       Generally, this will be used to add a comment too long to put at
  604.       the end of the current line.
  605.  
  606.       LABELS/Create single/Address symbol:
  607.               You will be requested for a string, which will become the
  608.       label for the current line.  Any references to the current line
  609.       will use the new label name, throughout the entire file,
  610.       immediately.
  611.  
  612.       LABELS/Create single/Address symbol dest:
  613.               The current line of code will be searched for references
  614.       to positions within the current file.  If any are found, ReSource
  615.       will make a decision on which type of data is at the position
  616.       referenced, it will then set the data type, and create a label at
  617.       that offset.  This new label will be immediately used for all
  618.       references to that location, which of course includes the
  619.       reference within the current line.  If the current line is not
  620.       being shown as code, or if there is no references, or there is a
  621.  
  622.       reference, but it is outside of the range of the current file,
  623.       then this function will do nothing.  Normally, this function will
  624.       only be used within macros, as it is easier and quicker to hold
  625.       down the left Amiga key, while holding down the left mouse
  626.       button, possibly while scrolling also.
  627.  
  628.       LABELS/Create single/Value symbol:
  629.               Following is several examples of address symbols
  630.       (labels), and value symbols.
  631.  
  632.       lbC000124        MOVE.B   bm_Depth(A0),D0
  633.  
  634.       In the above line, "lbC000124" is an address symbol, and
  635.       "bm_Depth" is a value symbol.
  636.  
  637.                        MOVE.B   bm_Depth(A0),DepthByte
  638.  
  639.       In this line, "DepthByte" is and a reference to an address symbol
  640.       (label), NOT a value symbol.
  641.  
  642.                        MOVE.L   #MEMF_CLEAR,D1
  643.  
  644.       In this line, "MEMF_CLEAR" is a value symbol.  If a value symbol
  645.       had not been created for this line, the line would be:
  646.  
  647.                        MOVE.L   #$10000,D1
  648.  
  649.       Address symbols (labels) always equate to a position within the
  650.       file, while value symbols may equate to any value at all.
  651.       Unfortunately, there is several cases where a value symbol may
  652.       equate to a position within the file:
  653.  
  654.                        MOVEA.L   #lbC000134,A0
  655.                        JSR       (A0)
  656.  
  657.       In this case, you may assign a value symbol, in which case the
  658.       value symbol will be shown, not the label name of the position
  659.       within the file that the instruction refers to.  If however, you
  660.       later remove the value symbol, the then label name of the line
  661.       being referenced (at present, this is "lbC000134"), will be
  662.       shown.  When you create an address symbol or value symbol, the
  663.       name is NOT checked for validity, it is up to you to decide
  664.       whether or not the assembler that you will be using will accept
  665.       the resulting code.  For example:
  666.  
  667.                        MOVE.L    #FFFFFFFA,D0
  668.  
  669.       may be changed to:
  670.  
  671.                        MOVE.L    #-6,D0
  672.  
  673.       by creating a value symbol "-6".  Virtually any value can be
  674.       given a value symbol, including bit numbers:
  675.  
  676.                        BTST      #AFB_68020,$0124(A6)
  677.  
  678.       LABELS/Create single/Value symbol - dest:
  679.               Similar to "LABELS/Create single/Value symbol" function,
  680.       except that the second reference within the current line will
  681.       used, rather than the first:
  682.  
  683.                        BTST      #4,SysFlags(A6)
  684.  
  685.       LABELS/Edit single:
  686.               All of these functions are identical to their
  687.       counterparts in "LABELS/Create single", except that if their is
  688.       an existing label/symbol/comment, you will be requested to edit
  689.       it, rather than create a new one.  Given the editing capabilities
  690.       of a string gadget, the create functions are a luxury really,
  691.       although I find that when I change a label/symbol/comment, I
  692.       generally make it nothing like the original, hence I nearly
  693.       always use the create functions, to save me the trouble of
  694.       pressing "rAmiga-X".
  695.  
  696.       LABELS/Remove single/Address symbol:
  697.               Remove any address symbol (label) for the current line.
  698.  
  699.       LABELS/Remove single/Value symbol:
  700.               Remove ALL value symbols in the current line.
  701.  
  702.       LABELS/Remove single/End-of-line comment:
  703.               Remove any end-of-line comment for the current line.
  704.  
  705.       LABELS/Remove single/All:
  706.               Remove all symbols and comments for the current line.
  707.  
  708.       LABELS/Create multiple/Reloc32 all:
  709.               For each reloc32 pointer within the current file,
  710.       determine the data type being referenced, set the data type, and
  711.       create a label at that address.  This function should be used
  712.       with caution, as when it makes a decision on the data type, it
  713.       does not have the same information available as when creating
  714.       labels normally.  This function should be most useful after
  715.       creating labels from all code in a program, where there is one or
  716.       more large tables of pointers.
  717.  
  718.       LABELS/Create multiple/All:
  719.               Starting at the current address, the "LABELS/Create
  720.       single/Address symbol dest" function is executed, and if ReSource
  721.       thinks that there was valid code in the current line, the
  722.       "CURSOR/Relative/Next line" function is executed, and the entire
  723.       function loops, otherwise the "PROJECT/-=Abort=-" function is
  724.       executed.  This function can make the disassembly process very
  725.       fast, the disadvantage being that there is a very slight chance
  726.       that what ReSource thinks is valid code, is really ascii, and
  727.       invalid labels will be created.
  728.  
  729.       SPECIAL FUNCTIONS/Repeat last command:
  730.               Execute the last function that was executed.  This does
  731.       not include most cursor movements.  By rebinding this function to
  732.       an easily-accessed key, such as the space bar, (and saving the
  733.       keytable) there should be much less need to rebind keys often.
  734.  
  735.       SPECIAL FUNCTIONS/Convert xx(A4) EA's
  736.               These functions were specifically designed to be used
  737.       when disassembling 'C' programs, in which the A4 register is used
  738.       as a base register for accessing data, throughout all or most of
  739.       the program.  Let's use an example program here:
  740.  
  741.                           SECTION  test000000,CODE
  742.                           LEA      START+$11E,A4
  743.                           LEA      0(A4),A1
  744.                           MOVE.L   $000C(A4),D0
  745.       .... rest of code
  746.                           SECTION  test00011E,DATA
  747.                           dc.b     'dos.library',0
  748.                           dc.l     $00010001
  749.                           END
  750.  
  751.       In the above program, the A4 register will point to the start of
  752.       the data segment.  There are three ways to tell ReSource where
  753.       the A4 register will point to; in the above example, the "This
  754.       operand" function could be used with the cursor at start of file,
  755.       or the "This address" function could be used with the cursor at
  756.       offset $00011E, or the "Specify" function could be used, suppying
  757.       a parameter of "11E".  Basically, with this function, you are
  758.       telling ReSource where, relative to the start of the program, the
  759.       A4 register can be assumed to be pointing.  After you do this,
  760.       any effective address that involves a word offset to the A4
  761.       register, will be shown as an absolute address.  Thus, the
  762.       example program above will appear as:
  763.  
  764.                           SECTION  test000000,CODE
  765.                           LEA      START+$011E,A4
  766.                           LEA      START+$011E,A1
  767.                           MOVE.L   START+$012A,D0
  768.       .... rest of code
  769.                           SECTION  test00011E,DATA
  770.                           dc.b     'dos.library',0
  771.                           dc.l     $00010001
  772.                           END
  773.  
  774.       The advantage here is that labels can automatically be created
  775.       where they could not before.  If this conversion process is not
  776.       used, it is likely that the program will not successfully re-
  777.       assemble, as different assemblers assemble the same source code
  778.       into different opcodes.  For example, the assembler that I
  779.       normally use does virtually no optimizing, and so the resulting
  780.       program is often larger than the original, even if I did not
  781.       modify the source code.  For example:
  782.  
  783.                           MOVE.L   4,A6
  784.  
  785.       If absolute long addressing is used, the instruction above will
  786.       be 6 bytes long, whereas if absolute short addressing is used, it
  787.       will be only 4 bytes long.  Where you wish to do EA conversions
  788.       in only a portion of a program, you can set the lower and upper
  789.       limits.
  790.  
  791.       Changing to absolute EA's will increase the size of the resulting
  792.       program, unless you convert back to relative addressing, within
  793.       the source code.  I believe that one of the features of BLINK
  794.       (from the Software Distillery) can help to make this conversion.
  795.  
  796.       SPECIAL FUNCTIONS/Convert specific EA's:
  797.               Please read and understand the "SPECIAL FUNCTIONS/Convert
  798.       xx(A4) EA's" functions first!  Where you want to do specific EA
  799.       conversions, use "Set base #1" (or #2, or #3), when the cursor is
  800.       the same as where the base register (whatever that is, it does
  801.       not have to be A4 this time) can be assumed to point to.
  802.       Assuming that you set base #1, and it is the A5 register that is
  803.       being used as a base register, you will then use the "Convert W/
  804.       Base #1" function to convert lines like:
  805.  
  806.                           MOVE.L   $0032(A5),A6
  807.  
  808.       .. into:
  809.  
  810.                           MOVE.L   lbL0014AC(A5),A6
  811.  
  812.       Note here that there has not actually been an EA conversion, but
  813.       a label has been created, the data type at label "lbL0014AC" has
  814.       been determined and set, and a value symbol ("lbL0014AC") has
  815.       been created for this line.  It is up to you then to make the
  816.       necessary changes to the resulting source code, if re-assembling
  817.       is required.  Whereas the "Convert xx(A4) EA's" function converts
  818.       immediately and automatically, you must use the "Convert W/Base
  819.       #1" function on each line that you want converted.  If you wish
  820.       to convert a destination address, first use the "SYMBOLS/Set
  821.       source/dest/Destination" function first.
  822.  
  823.       MACROS:
  824.               There are currently twelve user-definable macros
  825.       available in ReSource.  To start macro #1, select "MACROS/Start/
  826.       #1", select the functions to be included in the macro (you can
  827.       use the menus, or press keys, it's all the same thing to the
  828.       macro).  When you are done, select "MACROS/Start/#1" again, to
  829.       end the macro.  To run the macro, select "MACROS/Execute/#1".
  830.       The display is always refreshed during the defining of a macro,
  831.       however it is not during the execution.  At the end of a macro,
  832.       the display is always refreshed.  You may nest macros, but you
  833.       should not use recursion.  If ReSource finds that the nesting
  834.       level has exceeded 40, the macro will be abandoned.
  835.  
  836.               Macro files can be saved and re-loaded.  When ReSource
  837.       first starts up, it looks for "S:RS.macros".  If it finds it, it
  838.       will load it, and execute macro #12 immediately (that is why
  839.       macro #12 is hilited in the menus).  This is used to configure
  840.       ReSource.  Just start macro #12, set what option you want, end
  841.       macro #12, save the macro file as "S:RS.macros", and ReSource
  842.       will be configured every time that you run it.
  843.  
  844.       KEY BINDINGS:
  845.               Every function in ReSource can be found in the menus.
  846.       You do not need to use any keys at all, but you probably will
  847.       want to.  You can bind any function to any key.  All Amiga keys
  848.       are supported, you may use shift, alt, ctl, lAmiga, rAmiga,
  849.       shift-alt, shift-ctl, alt-ctl, or shift-alt-ctl in combination
  850.       with any key, as a distinct key to bind a function to.  Thus, you
  851.       have complete control over which keys do what.  After re-binding
  852.       some keys, you will probably want to save the keytable.  If you
  853.       save the keytable as "S:RS.keytable", it will be loaded every
  854.       time you run ReSource.  You may want to create several keytables,
  855.       suitable for doing differing program types (C, assembler, etc.).
  856.  
  857.       OPTIONS/Show offsets:
  858.               If this option is set to ON, all lines will start with
  859.       either a label, or the offset from the start of the file.
  860.  
  861.       OPTIONS/Display Beep:
  862.               If this option is set to ON, the "BeepDisplay" function
  863.       is used to give feedback to the user, that either a function has
  864.       failed, or that a lengthy function has completed, and that the
  865.       user should now wake up.
  866.  
  867.       OPTIONS/User Feedback:
  868.               If this option is set to ON, messages will appear in the
  869.       title bar, to let the user know what ReSource is doing,
  870.       especially while doing functions that take a lot of time,
  871.       extraordinary functions that only ReSource has direct control
  872.       over (such as dynamically allocating more memory for strings,
  873.       etc.), and also information about what hunks, etc., that it finds
  874.       in a load file.
  875.  
  876.       OPTIONS/Feedback Delays:
  877.               If this option is set to ON, whenever a feedback message
  878.       is displayed, ReSource will wait for you to read the message,
  879.       before continuing.  You will probably not want to keep this on
  880.       all the time, as it can slow down the disassembly process
  881.       somewhat, but while you are learning to use ReSource, it will
  882.       probably be very useful.
  883.  
  884.       OPTIONS/Labels:
  885.               If this option is set to ON, labels will be displayed.  This is
  886.       the default.
  887.  
  888.  
  889.       OPTIONS/Value symbols:
  890.              If this option is set to ON, value symbols will be displayed.
  891.       This is the default.
  892.  
  893.       OPTIONS/End-of-line comments:
  894.              If this option is set to ON, end-of-line comments will be
  895.       displayed.  This is the default.
  896.  
  897.       OPTIONS/Full-line comments:
  898.              If this option is set to ON, full-line comments will be
  899.       displayed.  This is the default.
  900.       ****************************************************************
  901.       Don't forget to put arp.library in your LIBS: directory!
  902.       ****************************************************************
  903.